import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
Vue.use(Router)

const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      name: 'Home',
      path: '/',
      component: Home,
      redirect: '/space',
      children: [
        {
          path: '/space',
          name: 'space',
          component: () =>
            import(/* webpackChunkName: "about" */ './views/Space.vue')
        },
        {
          path: '/management',
          name: 'management',
          component: () => import('./views/Management.vue')
        },
        {
          path: '/human-traffic',
          name: 'human-traffic',
          component: () => import('./views/Human-traffic.vue')
        },
        {
          path: '/car-traffic',
          name: 'car-traffic',
          component: () => import('./views/Car-traffic.vue')
        }
        // {
        //   path:'',
        //   name:'',
        //   component:()=>import('./views/')
        // }
      ]
    }
  ]
})
